{% extends 'index/layout.html' %}
{% load static %}
{% block css %}
    <link rel="stylesheet" href="{% static 'css/index.css' %}">
    <link rel="stylesheet" href="{% static 'css/iconfont.css' %}">
    <script src="{% static 'lib/layui/layui.js' %}" charset="utf-8"></script>
    <script type="text/javascript" src="{% static 'js/index.js' %}"></script>
    <script src="{% static 'js/jquery.js' %}"></script>
    <script src="{% static 'js/jquery.min.js' %}"></script>
    <script src="{% static 'js/survey.js' %}"></script>
    <style>
        #FontScroll {
            width: 100%;
            height: 245px;
            overflow: hidden;
        }

        #FontScroll ul li {
            height: 32px;
            width: 100%;
            color: #ffffff;
            line-height: 32px;
            overflow: hidden;
            font-size: 14px;
        }

        #FontScroll ul li i {
            color: red;
        }

        .layui-table td, .layui-table th {
            min-width: auto !important;
        }
    </style>
{% endblock %}

{% block content %}
    {% include 'index/welcome.html' %}
{% endblock %}

{% block js %}
    <script src="{% static 'js/fontscroll.js' %}"></script>
    <script src="{% static 'js/echarts.min.js' %}"></script>
    <script type="text/javascript">
        $(function () {
            $('.myscroll').myScroll({
                speed: 60, //数值越大，速度越慢
                rowHeight: 38 //li的高度
            });

        });
        function getTime() {
            var myDate = new Date();
            var myYear = myDate.getFullYear(); //获取完整的年份(4位,1970-????)
            var myMonth = myDate.getMonth() + 1; //获取当前月份(0-11,0代表1月)
            var myToday = myDate.getDate(); //获取当前日(1-31)
            var myDay = myDate.getDay(); //获取当前星期X(0-6,0代表星期天)
            var myHour = myDate.getHours(); //获取当前小时数(0-23)
            var myMinute = myDate.getMinutes(); //获取当前分钟数(0-59)
            var mySecond = myDate.getSeconds(); //获取当前秒数(0-59)
            var week = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];
            var nowTime;

            nowTime = myYear + '-' + fillZero(myMonth) + '-' + fillZero(myToday) + '&nbsp;&nbsp;' + fillZero(myHour) + ':' + fillZero(myMinute) + ':' + fillZero(mySecond) + '&nbsp;&nbsp;' + week[myDay] + '&nbsp;&nbsp;';
            //console.log(nowTime);
            $('#time').html(nowTime);
        };

        function fillZero(str) {
            var realNum;
            if (str < 10) {
                realNum = '0' + str;
            } else {
                realNum = str;
            }
            return realNum;
        }

        setInterval(getTime, 1000);
    </script>
{% endblock %}